package com.erbao.dp.observer;

/**
 * @author CaoBaoYin
 * @since 2021/9/13 21:12
 */
public class Main03 {
    public static void main(String[] args) {
        Child child = new Child();

        child.wakeup();
    }
}

class Dad {
    public void feed(){
        System.out.println(" dad feeding .......");
    }
}
class Child {
    private boolean cry = false;
    private Dad dad = new Dad();

    public boolean isCry () {
        return cry;
    }

    public void wakeup(){
        System.out.println("wake up ! wuwuuwuwuu……");
        cry = true;
        dad.feed();
    }
}
